import {createRouter,createWebHistory} from 'vue-router'
import IndexPage from '../components/IndexPage.vue'
import Login from '../components/Login.vue'
import DisplayData from '../pages/DisplayData.vue'
import ChargePile from '../pages/ChargePile.vue';
import ChargeStation from '../pages/ChargeStation.vue';
import NotFoundPage from '../pages/NotFoundPage.vue'
import OrderManage from '../pages/OrderManage.vue'
import UserPage from '../pages/UserPage.vue'
import index from '../pages/dashboard/Index.vue'
import Map from '../pages/MapTest.vue'
const router = createRouter({
	history:createWebHistory(),
	routes:[
		{
			path:'/index',
			component:IndexPage,
			children:[
				{
					path:'',
					component:DisplayData
				},
				{
					path:'index',
					component:IndexPage
				},
				{
					path:'chargepile',
					component:ChargePile
				},
				{
					path:'chargestation',
					component:ChargeStation
				},
				{
					path:'order',
					component:OrderManage
				},
				{
					path:'user',
					component:UserPage
				},
				{
					path:'dashboard',
					component:index
				},
				{
					path:'map',
					component:Map
				}
			]
		},
		{
			path:'/login',
			component:Login
		},
        {
            path:'/',
            redirect:'/login'
		},				
		{
			path: '/:catchAll(.*)', 
			component:NotFoundPage
		}
		
	]
})

export default router